<?php
	$id = $_POST['myid'];
	$text = $_POST['mytext'];
	
	mysql_connect("localhost", "root", "", FALSE);
	@mysql_select_db("jack_file") or die("Unable to select database");
	$result = mysql_query('UPDATE files SET text = \'' .$text. '\' WHERE id = ' .$id);
	if (!$result) {
		die('Invalid query: ' . mysql_error());
	}
	echo $text;
	mysql_close();

?>